double getXsec(int);
double getXsec(int nRun)
{
  double proc_xsec(1.); //x-sec in Pico barn

  proc_xsec = 0;
  //W+jets
  if(nRun==107680) proc_xsec=1.19887*6913.3;
  if(nRun==107681) proc_xsec=1.19887*1293.0;
  if(nRun==107682) proc_xsec=1.19887*377.1;
  if(nRun==107683) proc_xsec=1.19887*100.9;
  if(nRun==107684) proc_xsec=1.19887*25.3;
  if(nRun==107685) proc_xsec=1.19887*6.9;

  if(nRun==107690) proc_xsec=1.19887*6913.3;
  if(nRun==107691) proc_xsec=1.19887*1293.0;
  if(nRun==107692) proc_xsec=1.19887*377.1;
  if(nRun==107693) proc_xsec=1.19887*100.9;
  if(nRun==107694) proc_xsec=1.19887*25.3;
  if(nRun==107695) proc_xsec=1.19887*6.9;

  if(nRun==107700) proc_xsec=1.19887*6913.3;
  if(nRun==107701) proc_xsec=1.19887*1293.0;
  if(nRun==107702) proc_xsec=1.19887*377.1;
  if(nRun==107703) proc_xsec=1.19887*100.9;
  if(nRun==107704) proc_xsec=1.19887*25.3;
  if(nRun==107705) proc_xsec=1.19887*6.9;


  //Z+jets
  if(nRun==107650) proc_xsec=830.125;
  if(nRun==107651) proc_xsec=166.2375;
  if(nRun==107652) proc_xsec=50.2825;
  if(nRun==107653) proc_xsec=13.9225;
  if(nRun==107654) proc_xsec=3.615625;
  if(nRun==107655) proc_xsec=0.9417875;

  if(nRun==107660) proc_xsec=830.125;
  if(nRun==107661) proc_xsec=166.2375;
  if(nRun==107662) proc_xsec=50.2825;
  if(nRun==107663) proc_xsec=13.9225;
  if(nRun==107664) proc_xsec=3.615625;
  if(nRun==107665) proc_xsec=0.9417875;

  if(nRun==107670) proc_xsec=830.125;
  if(nRun==107671) proc_xsec=166.2375;
  if(nRun==107672) proc_xsec=50.2825;
  if(nRun==107673) proc_xsec=13.9225;
  if(nRun==107674) proc_xsec=3.615625;
  if(nRun==107675) proc_xsec=0.9417875;

  // DY +jets
  if(nRun==116250) proc_xsec=3054.7;
  if(nRun==116251) proc_xsec=84.91;
  if(nRun==116252) proc_xsec=41.19;
  if(nRun==116253) proc_xsec=8.35;
  if(nRun==116254) proc_xsec=1.85;
  if(nRun==116255) proc_xsec=0.46;

  if(nRun==116260) proc_xsec=3054.9;
  if(nRun==116261) proc_xsec=84.78;
  if(nRun==116262) proc_xsec=41.13;
  if(nRun==116263) proc_xsec=8.34;
  if(nRun==116264) proc_xsec=1.87;
  if(nRun==116265) proc_xsec=0.46;

  if(nRun==116270) proc_xsec=3054.8;
  if(nRun==116271) proc_xsec=84.88;
  if(nRun==116272) proc_xsec=41.28;
  if(nRun==116273) proc_xsec=8.35;
  if(nRun==116274) proc_xsec=1.83;
  if(nRun==116275) proc_xsec=0.46;

  // DY
  if(nRun==108319) proc_xsec=1252.9;
  if(nRun==108320) proc_xsec=1253.0;

/*   if(nRun==107650) proc_xsec=611.1; */
/*   if(nRun==107651) proc_xsec=126.5; */
/*   if(nRun==107652) proc_xsec=38.2; */
/*   if(nRun==107653) proc_xsec=10.6; */
/*   if(nRun==107654) proc_xsec=2.6; */
/*   if(nRun==107655) proc_xsec=0.7; */
/*   if(nRun==107660) proc_xsec=607.1; */
/*   if(nRun==107661) proc_xsec=126.0; */
/*   if(nRun==107662) proc_xsec=37.6; */
/*   if(nRun==107663) proc_xsec=10.5; */
/*   if(nRun==107664) proc_xsec=2.7; */
/*   if(nRun==107665) proc_xsec=0.7; */
/*   if(nRun==107670) proc_xsec=606.9; */
/*   if(nRun==107671) proc_xsec=126.2; */
/*   if(nRun==107672) proc_xsec=38.3; */
/*   if(nRun==107673) proc_xsec=10.5; */
/*   if(nRun==107674) proc_xsec=2.7; */
/*   if(nRun==107675) proc_xsec=0.7; */

  //SingleTop
  if(nRun==108340) proc_xsec=7.;//7.152;
  if(nRun==108341) proc_xsec=7.;//7.176;
  if(nRun==108342) proc_xsec=7.;//7.128;
  if(nRun==108343) proc_xsec=0.468;//0.4685;
  if(nRun==108344) proc_xsec=0.468;//0.4684;
  if(nRun==108345) proc_xsec=0.468;//0.4700;
  if(nRun==108346) proc_xsec=13.0;//14.581;

  //SU4+ttbar
  if(nRun==106484) proc_xsec=59.95 ;//63.95; //41.5*1.53
  if(nRun==106400) proc_xsec=47.925*1.53;
  if(nRun==105200) proc_xsec=160.79*0.556;//80.201*1.09;
  if(nRun==105861) proc_xsec=72.906*1.2;

  //Jx unfilt
  if(nRun==105009) proc_xsec=9752970000.;
  if(nRun==105010) proc_xsec=673020000;
  if(nRun==105011) proc_xsec=41194700;
  if(nRun==105012) proc_xsec=2193250;
  if(nRun==105013) proc_xsec=87848.7;
  if(nRun==105014) proc_xsec=2328.56;
  if(nRun==105015) proc_xsec=33.8461;
  if(nRun==105016) proc_xsec=0.13741;
  if(nRun==105802) proc_xsec=1147580000*0.08623068;

  // Jx muonfilt
  if(nRun==109276) proc_xsec=9.8605E+06*8.5572E-05*1000. ;//779.0*1.e3;//9860260;
  if(nRun==109277) proc_xsec=6.7804E+05*1.2111E-03*1000. ;//836.0*1.e3;//677889;
  if(nRun==109278) proc_xsec=4.0968E+04*5.4310E-03*1000. ;//223.0*1.e3;//40985;
  if(nRun==109279) proc_xsec=2.1929E+03*1.3051E-02*1000. ; //28.4*1.e3;//2195.5;
  if(nRun==109280) proc_xsec=8.7665E+01*2.2357E-02*1000.;//1.94*1e3;//87.6596;
  if(nRun==109281) proc_xsec=2.3488E+00*3.0230E-02*1000. ;//0.0698*1.e3;
  if(nRun==109435) proc_xsec=1.15 ;//0.0698*1.e3;

  //bbbar, ccbar pythia
  if(nRun==108405) proc_xsec=73.9*1000.;
  if(nRun==108326) proc_xsec=75.1266*1000.;
  if(nRun==108327) proc_xsec=27.7*1000.;
  if(nRun==106059) proc_xsec=31.8532*1000;

  // Diboson mcatnlo
  if(nRun==105921) proc_xsec=0.508000;
  if(nRun==105922) proc_xsec=0.508000;
  if(nRun==105923) proc_xsec=0.502000;
  if(nRun==105924) proc_xsec=0.506000;
  if(nRun==105925) proc_xsec=0.497000;
  if(nRun==105926) proc_xsec=0.510000;
  if(nRun==105927) proc_xsec=0.499000;
  if(nRun==105928) proc_xsec=0.507000;
  if(nRun==105929) proc_xsec=0.514000;
  if(nRun==105940) proc_xsec=1.668082;
  if(nRun==105941) proc_xsec=0.166043;
  if(nRun==105942) proc_xsec=0.526479;
  if(nRun==105970) proc_xsec=0.910426;
  if(nRun==105971) proc_xsec=0.090625;
  if(nRun==105972) proc_xsec=0.287348;
  if(nRun==105930) proc_xsec=0.271999;
  if(nRun==105931) proc_xsec=2.825899;
  if(nRun==105932) proc_xsec=0.077814;

  //Wbb alpgen
  if(nRun==106280) proc_xsec=3.2;
  if(nRun==106281) proc_xsec=2.6;
  if(nRun==106282) proc_xsec=1.4;
  if(nRun==106283) proc_xsec=0.6;

  //WW/WZ/ZZ Herwig
  if(nRun==105985) proc_xsec=44.9*0.3884;
  if(nRun==105986) proc_xsec=5.96*0,.2123;
  if(nRun==105987) proc_xsec=18.0*0.3085;

  if(nRun==119357) proc_xsec=0.22;

  ///MSSM24 Grids
  if(nRun==114217) proc_xsec=4.30 ;
  if(nRun==114218) proc_xsec=3.26 ;
  if(nRun==114219) proc_xsec=3.50 ;
  if(nRun==114220) proc_xsec=2.73 ;
  if(nRun==114221) proc_xsec=2.64 ;
  if(nRun==114222) proc_xsec=2.62 ;
  if(nRun==114223) proc_xsec=2.98 ;
  if(nRun==114224) proc_xsec=2.80 ;
  if(nRun==114225) proc_xsec=2.75 ;
  if(nRun==114226) proc_xsec=2.65 ;
  if(nRun==114227) proc_xsec=7.56 ;
  if(nRun==114228) proc_xsec=6.05 ;
  if(nRun==114229) proc_xsec=6.28 ;
  if(nRun==114230) proc_xsec=5.41 ;
  if(nRun==114231) proc_xsec=5.41 ;
  if(nRun==114232) proc_xsec=5.41 ;
  if(nRun==114233) proc_xsec=5.66 ;
  if(nRun==114234) proc_xsec=5.48 ;
  if(nRun==114235) proc_xsec=5.42 ;
  if(nRun==114236) proc_xsec=5.42 ;
  if(nRun==114237) proc_xsec=32.00;
  if(nRun==114238) proc_xsec=30.85;
  if(nRun==114239) proc_xsec=31.09;
  if(nRun==114240) proc_xsec=30.17;
  if(nRun==114241) proc_xsec=30.02;
  if(nRun==114242) proc_xsec=30.00;
  if(nRun==114243) proc_xsec=30.42;
  if(nRun==114244) proc_xsec=30.24;
  if(nRun==114245) proc_xsec=30.18;
  if(nRun==114246) proc_xsec=30.03;
  ///MSUGRA GRID tanBeta3
  if(nRun==114040) proc_xsec=453.4000;
  if(nRun==114041) proc_xsec=244.9000;
  if(nRun==114042) proc_xsec=140.2000;
  if(nRun==114043) proc_xsec=83.8300;
  if(nRun==114044) proc_xsec=51.7900;
  if(nRun==114045) proc_xsec=32.9900;
  if(nRun==114046) proc_xsec=21.6000;
  if(nRun==114047) proc_xsec=14.4440;
  if(nRun==114048) proc_xsec=9.9120;
  if(nRun==114049) proc_xsec=4.8480;
  if(nRun==114050) proc_xsec=2.4770;
  if(nRun==114051) proc_xsec=1.3314;
  if(nRun==114052) proc_xsec=0.7392;
  if(nRun==114053) proc_xsec=379.3000;
  if(nRun==114054) proc_xsec=208.9000;
  if(nRun==114055) proc_xsec=121.4800;
  if(nRun==114056) proc_xsec=73.6200;
  if(nRun==114057) proc_xsec=46.2100;
  if(nRun==114058) proc_xsec=29.6800;
  if(nRun==114059) proc_xsec=19.6100;
  if(nRun==114060) proc_xsec=13.2650;
  if(nRun==114061) proc_xsec=9.1230;
  if(nRun==114062) proc_xsec=314.1000;
  if(nRun==114063) proc_xsec=175.8300;
  if(nRun==114064) proc_xsec=103.9800;
  if(nRun==114065) proc_xsec=63.8600;
  if(nRun==114066) proc_xsec=40.4200;
  if(nRun==114067) proc_xsec=26.3200;
  if(nRun==114068) proc_xsec=17.5240;
  if(nRun==114069) proc_xsec=11.9120;
  if(nRun==114070) proc_xsec=8.2680;
  if(nRun==114071) proc_xsec=4.1360;
  if(nRun==114072) proc_xsec=2.1606;
  if(nRun==114073) proc_xsec=1.1792;
  if(nRun==114074) proc_xsec=0.6583;
  if(nRun==114075) proc_xsec=258.6600;
  if(nRun==114076) proc_xsec=146.7100;
  if(nRun==114077) proc_xsec=87.9200;
  if(nRun==114078) proc_xsec=54.5100;
  if(nRun==114079) proc_xsec=34.9800;
  if(nRun==114080) proc_xsec=22.9400;
  if(nRun==114081) proc_xsec=15.4500;
  if(nRun==114082) proc_xsec=10.5810;
  if(nRun==114083) proc_xsec=7.3920;
  if(nRun==114084) proc_xsec=215.6100;
  if(nRun==114085) proc_xsec=122.7700;
  if(nRun==114086) proc_xsec=74.0600;
  if(nRun==114087) proc_xsec=46.3800;
  if(nRun==114088) proc_xsec=30.0800;
  if(nRun==114089) proc_xsec=19.9100;
  if(nRun==114090) proc_xsec=13.4800;
  if(nRun==114091) proc_xsec=9.3190;
  if(nRun==114092) proc_xsec=6.5450;
  if(nRun==114093) proc_xsec=3.3490;
  if(nRun==114094) proc_xsec=1.7928;
  if(nRun==114095) proc_xsec=0.9900;
  if(nRun==114096) proc_xsec=0.5653;
  if(nRun==114097) proc_xsec=181.4400;
  if(nRun==114098) proc_xsec=103.2400;
  if(nRun==114099) proc_xsec=62.6500;
  if(nRun==114100) proc_xsec=39.4900;
  if(nRun==114101) proc_xsec=25.6800;
  if(nRun==114102) proc_xsec=17.1290;
  if(nRun==114103) proc_xsec=11.6760;
  if(nRun==114104) proc_xsec=8.1280;
  if(nRun==114105) proc_xsec=5.7560;
  if(nRun==114106) proc_xsec=154.9700;
  if(nRun==114107) proc_xsec=87.8500;
  if(nRun==114108) proc_xsec=53.2900;
  if(nRun==114109) proc_xsec=33.6300;
  if(nRun==114110) proc_xsec=21.9820;
  if(nRun==114111) proc_xsec=14.7280;
  if(nRun==114112) proc_xsec=10.0970;
  if(nRun==114113) proc_xsec=7.0660;
  if(nRun==114114) proc_xsec=5.0240;
  if(nRun==114115) proc_xsec=2.6220;
  if(nRun==114116) proc_xsec=1.4234;
  if(nRun==114117) proc_xsec=0.8074;
  if(nRun==114118) proc_xsec=0.4650;
  if(nRun==114119) proc_xsec=134.2400;
  if(nRun==114120) proc_xsec=75.7000;
  if(nRun==114121) proc_xsec=45.6600;
  if(nRun==114122) proc_xsec=28.7450;
  if(nRun==114123) proc_xsec=18.8950;
  if(nRun==114124) proc_xsec=12.7520;
  if(nRun==114125) proc_xsec=8.7280;
  if(nRun==114126) proc_xsec=6.1300;
  if(nRun==114127) proc_xsec=4.3800;
  if(nRun==114128) proc_xsec=584.9000;
  if(nRun==114129) proc_xsec=304.6000;
  if(nRun==114130) proc_xsec=169.1000;
  if(nRun==114131) proc_xsec=98.6500;
  if(nRun==114132) proc_xsec=59.9400;
  if(nRun==114133) proc_xsec=37.6800;
  if(nRun==114134) proc_xsec=24.3300;
  if(nRun==114135) proc_xsec=16.1330;
  if(nRun==114136) proc_xsec=10.9630;
  if(nRun==114137) proc_xsec=5.2620;
  if(nRun==114138) proc_xsec=2.6700;
  if(nRun==114139) proc_xsec=1.4202;
  if(nRun==114140) proc_xsec=0.7847;
  if(nRun==114141) proc_xsec=117.9500;
  if(nRun==114142) proc_xsec=65.8100;
  if(nRun==114143) proc_xsec=39.4730;
  if(nRun==114144) proc_xsec=24.9150;
  if(nRun==114145) proc_xsec=16.3180;
  if(nRun==114146) proc_xsec=11.0280;
  if(nRun==114147) proc_xsec=7.6000;
  if(nRun==114148) proc_xsec=5.3060;
  if(nRun==114149) proc_xsec=3.8060;
  if(nRun==114150) proc_xsec=2.0123;
  if(nRun==114151) proc_xsec=1.1100;
  if(nRun==114152) proc_xsec=0.6339;
  if(nRun==114153) proc_xsec=0.3735;
  if(nRun==114154) proc_xsec=95.1760;
  if(nRun==114155) proc_xsec=30.4550;
  if(nRun==114156) proc_xsec=12.3770;
  if(nRun==114157) proc_xsec=5.7260;
  if(nRun==114158) proc_xsec=2.8816;
  if(nRun==114159) proc_xsec=1.5383;
  if(nRun==114160) proc_xsec=0.8569;
  if(nRun==114161) proc_xsec=0.4927;
  if(nRun==114162) proc_xsec=0.2929;
  if(nRun==114163) proc_xsec=80.1770;
  if(nRun==114164) proc_xsec=24.7250;
  if(nRun==114165) proc_xsec=9.6930;
  if(nRun==114166) proc_xsec=4.4205;
  if(nRun==114167) proc_xsec=2.2066;
  if(nRun==114168) proc_xsec=1.1766;
  if(nRun==114169) proc_xsec=0.6575;
  if(nRun==114170) proc_xsec=0.3813;
  if(nRun==114171) proc_xsec=0.2266;
  if(nRun==114172) proc_xsec=70.1500;
  if(nRun==114173) proc_xsec=20.7810;
  if(nRun==114174) proc_xsec=7.8935;
  if(nRun==114175) proc_xsec=3.4958;
  if(nRun==114176) proc_xsec=1.7214;
  if(nRun==114177) proc_xsec=0.9112;
  if(nRun==114178) proc_xsec=0.5103;
  if(nRun==114179) proc_xsec=0.2932;
  if(nRun==114180) proc_xsec=0.1752;
  if(nRun==114181) proc_xsec=63.4310;
  if(nRun==114182) proc_xsec=18.2951;
  if(nRun==114183) proc_xsec=6.6350;
  if(nRun==114184) proc_xsec=2.8666;
  if(nRun==114185) proc_xsec=1.3777;
  if(nRun==114186) proc_xsec=0.7170;
  if(nRun==114187) proc_xsec=0.3997;
  if(nRun==114188) proc_xsec=0.2296;
  if(nRun==114189) proc_xsec=0.1357;
  if(nRun==114190) proc_xsec=527.0000;
  if(nRun==114191) proc_xsec=279.1000;
  if(nRun==114192) proc_xsec=157.6000;
  if(nRun==114193) proc_xsec=92.7400;
  if(nRun==114194) proc_xsec=56.6100;
  if(nRun==114195) proc_xsec=35.9300;
  if(nRun==114196) proc_xsec=23.3100;
  if(nRun==114197) proc_xsec=15.4730;
  if(nRun==114198) proc_xsec=10.5270;
  if(nRun==114199) proc_xsec=58.3199;
  if(nRun==114200) proc_xsec=16.3023;
  if(nRun==114201) proc_xsec=5.8137;
  if(nRun==114202) proc_xsec=2.4181;
  if(nRun==114203) proc_xsec=1.1338;
  if(nRun==114204) proc_xsec=0.5765;
  if(nRun==114205) proc_xsec=0.3156;
  if(nRun==114206) proc_xsec=0.1801;
  if(nRun==114207) proc_xsec=0.1058;
  if(nRun==114208) proc_xsec=54.5271;
  if(nRun==114209) proc_xsec=14.9549;
  if(nRun==114210) proc_xsec=5.1721;
  if(nRun==114211) proc_xsec=2.0895;
  if(nRun==114212) proc_xsec=0.9531;
  if(nRun==114213) proc_xsec=0.4762;
  if(nRun==114214) proc_xsec=0.2560;
  if(nRun==114215) proc_xsec=0.1436;
  if(nRun==114216) proc_xsec=0.0836;
  if(nRun==114013) proc_xsec=51.4996;
  if(nRun==114014) proc_xsec=13.7888;
  if(nRun==114015) proc_xsec=4.7045;
  if(nRun==114016) proc_xsec=1.8563;
  if(nRun==114017) proc_xsec=0.8251;
  if(nRun==114018) proc_xsec=0.4021;
  if(nRun==114019) proc_xsec=0.2121;
  if(nRun==114020) proc_xsec=0.1170;
  if(nRun==114021) proc_xsec=0.0671;
  if(nRun==114022) proc_xsec=48.9185;
  if(nRun==114023) proc_xsec=13.0192;
  if(nRun==114024) proc_xsec=4.3502;
  if(nRun==114025) proc_xsec=1.6796;
  if(nRun==114026) proc_xsec=0.7303;
  if(nRun==114027) proc_xsec=0.3484;
  if(nRun==114028) proc_xsec=0.1800;
  if(nRun==114029) proc_xsec=0.0973;
  if(nRun==114030) proc_xsec=0.0548;
  if(nRun==114031) proc_xsec=46.9747;
  if(nRun==114032) proc_xsec=12.3689;
  if(nRun==114033) proc_xsec=4.0739;
  if(nRun==114034) proc_xsec=1.5510;
  if(nRun==114035) proc_xsec=0.6617;
  if(nRun==114036) proc_xsec=0.3082;
  if(nRun==114037) proc_xsec=0.1562;
  if(nRun==114038) proc_xsec=0.0827;
  if(nRun==114039) proc_xsec=0.0458;

  ///Pheno Grid
  if(nRun==114944)proc_xsec=27.564;
  if(nRun==114943)proc_xsec=27.564;
  if(nRun==114942)proc_xsec=101.477;
  if(nRun==114941)proc_xsec=101.477;
  if(nRun==114940)proc_xsec=209.44;
  if(nRun==114939)proc_xsec=209.44;
  if(nRun==114938)proc_xsec=78.7968;
  if(nRun==114937)proc_xsec=78.7968;
  if(nRun==114936)proc_xsec=95.989;
  if(nRun==114935)proc_xsec=95.989;
  if(nRun==114934)proc_xsec=134.466;
  if(nRun==114933)proc_xsec=134.466;
  if(nRun==114932)proc_xsec=1.91328;
  if(nRun==114931)proc_xsec=1.91328;
  if(nRun==114930)proc_xsec=3.3283;
  if(nRun==114929)proc_xsec=3.3283;
  if(nRun==114928)proc_xsec=6.1606;
  if(nRun==114927)proc_xsec=6.1606;
  if(nRun==114926)proc_xsec=14.0292;
  if(nRun==114925)proc_xsec=14.0292;
  if(nRun==114924)proc_xsec=6.1891;
  if(nRun==114923)proc_xsec=6.1891;
  if(nRun==114922)proc_xsec=4.62389;
  if(nRun==114921)proc_xsec=4.62389;
  if(nRun==114920)proc_xsec=11.1772;
  if(nRun==114919)proc_xsec=11.1772;
  if(nRun==114918)proc_xsec=22.659;
  if(nRun==114917)proc_xsec=22.659;
  if(nRun==114916)proc_xsec=23.6644;
  if(nRun==114915)proc_xsec=23.6644;
  if(nRun==114914)proc_xsec=14.2925;
  if(nRun==114913)proc_xsec=14.2925;
  if(nRun==114912)proc_xsec=18.1231;
  if(nRun==114911)proc_xsec=18.1231;
  if(nRun==114910)proc_xsec=45.776;
  if(nRun==114909)proc_xsec=45.776;
  if(nRun==114908)proc_xsec=118.015;
  if(nRun==114907)proc_xsec=118.015;
  if(nRun==114906)proc_xsec=69.0193;
  if(nRun==114905)proc_xsec=69.0193;
  if(nRun==114904)proc_xsec=76.6969;
  if(nRun==114903)proc_xsec=76.6969;
  if(nRun==114902)proc_xsec=93.651;
  if(nRun==114901)proc_xsec=93.651;
  if(nRun==114964)proc_xsec=3.6292;
  if(nRun==114963)proc_xsec=3.6292;
  if(nRun==114962)proc_xsec=7.1646;
  if(nRun==114961)proc_xsec=7.1646;
  if(nRun==114960)proc_xsec=15.8127;
  if(nRun==114959)proc_xsec=15.8127;
  if(nRun==114958)proc_xsec=44.5695;
  if(nRun==114957)proc_xsec=44.5695;
  if(nRun==114956)proc_xsec=11.512;
  if(nRun==114955)proc_xsec=11.512;
  if(nRun==114954)proc_xsec=7.3505;
  if(nRun==114953)proc_xsec=7.3505;
  if(nRun==114952)proc_xsec=24.207;
  if(nRun==114951)proc_xsec=24.207;
  if(nRun==114950)proc_xsec=61.804;
  if(nRun==114949)proc_xsec=61.804;
  if(nRun==114948)proc_xsec=43.054;
  if(nRun==114947)proc_xsec=43.054;
  if(nRun==114946)proc_xsec=19.0456;
  if(nRun==114945)proc_xsec=19.0456;

//xsection for DGnoL
if(nRun==138274)proc_xsec=1000*2.6192*0.00044785;
if(nRun==138275)proc_xsec=1000*0.3006*0.0022723;
if(nRun==138276)proc_xsec=1000*0.15065*0.0035096;
if(nRun==138277)proc_xsec=1000*0.074863*0.0045425;
if(nRun==138278)proc_xsec=1000*0.050341*0.0046012;
if(nRun==138279)proc_xsec=1000*0.038609*0.004208;
if(nRun==138280)proc_xsec=1000*0.023754*0.0020598;
if(nRun==138281)proc_xsec=1000*0.32062*0.0028639;
if(nRun==138282)proc_xsec=1000*0.13643*0.0051106;
if(nRun==138283)proc_xsec=1000*0.083122*0.0066824;
if(nRun==138284)proc_xsec=1000*0.04651*0.0082226;
if(nRun==138285)proc_xsec=1000*0.032496*0.0089814;
if(nRun==138286)proc_xsec=1000*0.025307*0.0084751;
if(nRun==138287)proc_xsec=1000*0.01591*0.0056688;
if(nRun==138288)proc_xsec=1000*0.15681*0.0053605;
if(nRun==138289)proc_xsec=1000*0.080254*0.0086019;
if(nRun==138290)proc_xsec=1000*0.053888*0.010613;
if(nRun==138291)proc_xsec=1000*0.031717*0.013841;
if(nRun==138292)proc_xsec=1000*0.022465*0.015384;
if(nRun==138293)proc_xsec=1000*0.017611*0.016353;
if(nRun==138294)proc_xsec=1000*0.011151*0.013747;
if(nRun==138295)proc_xsec=1000*0.064737*0.012307;
if(nRun==138296)proc_xsec=1000*0.040362*0.016923;
if(nRun==138297)proc_xsec=1000*0.028566*0.020304;
if(nRun==138298)proc_xsec=1000*0.01741*0.028547;
if(nRun==138299)proc_xsec=1000*0.012409*0.03382;
if(nRun==138300)proc_xsec=1000*0.0097092*0.038065;
if(nRun==138301)proc_xsec=1000*0.0060641*0.046638;
if(nRun==138302)proc_xsec=1000*0.038601*0.019518;
if(nRun==138303)proc_xsec=1000*0.025383*0.024952;
if(nRun==138304)proc_xsec=1000*0.018222*0.030429;
if(nRun==138305)proc_xsec=1000*0.011112*0.043283;
if(nRun==138306)proc_xsec=1000*0.0077878*0.051524;
if(nRun==138307)proc_xsec=1000*0.0060404*0.058618;
if(nRun==138308)proc_xsec=1000*0.0036316*0.073216;
if(nRun==138309)proc_xsec=1000*0.027131*0.024965;
if(nRun==138310)proc_xsec=1000*0.01816*0.032324;
if(nRun==138311)proc_xsec=1000*0.013069*0.040731;
if(nRun==138312)proc_xsec=1000*0.0078569*0.054852;
if(nRun==138313)proc_xsec=1000*0.0054003*0.067445;
if(nRun==138314)proc_xsec=1000*0.0040917*0.070965;
if(nRun==138315)proc_xsec=1000*0.0023262*0.091436;
if(nRun==138316)proc_xsec=1000*0.013974*0.036709;
if(nRun==138317)proc_xsec=1000*0.0094258*0.044888;
if(nRun==138318)proc_xsec=1000*0.0067169*0.054389;
if(nRun==138319)proc_xsec=1000*0.0038298*0.06991;
if(nRun==138320)proc_xsec=1000*0.0024535*0.084283;
if(nRun==138321)proc_xsec=1000*0.0017054*0.099621;
if(nRun==138322)proc_xsec=1000*0.0007606*0.12496;
if(nRun==138323)proc_xsec=1000*1.3779*0.00039589;
if(nRun==138324)proc_xsec=1000*0.25648*0.0014579;
if(nRun==138325)proc_xsec=1000*0.13922*0.0019737;
if(nRun==138326)proc_xsec=1000*0.072525*0.0021416;
if(nRun==138327)proc_xsec=1000*0.04941*0.0021207;
if(nRun==138328)proc_xsec=1000*0.038101*0.0019347;
if(nRun==138329)proc_xsec=1000*0.023545*0.0010862;
if(nRun==138330)proc_xsec=1000*0.25822*0.0019783;
if(nRun==138331)proc_xsec=1000*0.12216*0.0030512;
if(nRun==138332)proc_xsec=1000*0.078997*0.0037813;
if(nRun==138333)proc_xsec=1000*0.045371*0.0035733;
if(nRun==138334)proc_xsec=1000*0.031945*0.0034042;
if(nRun==138335)proc_xsec=1000*0.025032*0.0030182;
if(nRun==138336)proc_xsec=1000*0.015794*0.0016003;
if(nRun==138337)proc_xsec=1000*0.13097*0.0037728;
if(nRun==138338)proc_xsec=1000*0.075097*0.005078;
if(nRun==138339)proc_xsec=1000*0.051653*0.0058142;
if(nRun==138340)proc_xsec=1000*0.031028*0.0059329;
if(nRun==138341)proc_xsec=1000*0.022141*0.0052429;
if(nRun==138342)proc_xsec=1000*0.017458*0.0047211;
if(nRun==138343)proc_xsec=1000*0.011086*0.0023362;
if(nRun==138344)proc_xsec=1000*0.059467*0.0082674;
if(nRun==138345)proc_xsec=1000*0.03857*0.0099065;
if(nRun==138346)proc_xsec=1000*0.027717*0.010953;
if(nRun==138347)proc_xsec=1000*0.017097*0.011748;
if(nRun==138348)proc_xsec=1000*0.012248*0.012032;
if(nRun==138349)proc_xsec=1000*0.0096182*0.011479;
if(nRun==138350)proc_xsec=1000*0.0060285*0.0062631;
if(nRun==138351)proc_xsec=1000*0.036429*0.012698;
if(nRun==138352)proc_xsec=1000*0.024339*0.015361;
if(nRun==138353)proc_xsec=1000*0.017736*0.016695;
if(nRun==138354)proc_xsec=1000*0.010941*0.019693;
if(nRun==138355)proc_xsec=1000*0.0077355*0.021716;
if(nRun==138356)proc_xsec=1000*0.0059745*0.023359;
if(nRun==138357)proc_xsec=1000*0.0036144*0.020726;
if(nRun==138358)proc_xsec=1000*0.02584*0.016932;
if(nRun==138359)proc_xsec=1000*0.017544*0.02003;
if(nRun==138360)proc_xsec=1000*0.012741*0.022635;
if(nRun==138361)proc_xsec=1000*0.0077679*0.028826;
if(nRun==138362)proc_xsec=1000*0.0053634*0.034889;
if(nRun==138363)proc_xsec=1000*0.004062*0.040545;
if(nRun==138364)proc_xsec=1000*0.0023366*0.047749;
if(nRun==138365)proc_xsec=1000*0.013466*0.024701;
if(nRun==138366)proc_xsec=1000*0.0091665*0.030427;
if(nRun==138367)proc_xsec=1000*0.0065826*0.035;
if(nRun==138368)proc_xsec=1000*0.0037748*0.048525;
if(nRun==138369)proc_xsec=1000*0.0024235*0.065467;
if(nRun==138370)proc_xsec=1000*0.0016958*0.080171;
if(nRun==138371)proc_xsec=1000*0.00075905*0.11024;
if(nRun==138372)proc_xsec=1000*1.11*0.00031111;
if(nRun==138373)proc_xsec=1000*0.22813*0.0010489;
if(nRun==138374)proc_xsec=1000*0.13109*0.0013657;
if(nRun==138375)proc_xsec=1000*0.070294*0.0015652;
if(nRun==138376)proc_xsec=1000*0.048396*0.0016204;
if(nRun==138377)proc_xsec=1000*0.03754*0.0015269;
if(nRun==138378)proc_xsec=1000*0.023384*0.00090598;
if(nRun==138379)proc_xsec=1000*0.22018*0.0014841;
if(nRun==138380)proc_xsec=1000*0.11372*0.0021213;
if(nRun==138381)proc_xsec=1000*0.075371*0.0023756;
if(nRun==138382)proc_xsec=1000*0.0442*0.0023874;
if(nRun==138383)proc_xsec=1000*0.031393*0.0023421;
if(nRun==138384)proc_xsec=1000*0.024712*0.0023353;
if(nRun==138385)proc_xsec=1000*0.015692*0.0013721;
if(nRun==138386)proc_xsec=1000*0.11789*0.0026616;
if(nRun==138387)proc_xsec=1000*0.07103*0.0033709;
if(nRun==138388)proc_xsec=1000*0.049608*0.0035756;
if(nRun==138389)proc_xsec=1000*0.030306*0.0034748;
if(nRun==138390)proc_xsec=1000*0.021813*0.0031787;
if(nRun==138391)proc_xsec=1000*0.017253*0.0031029;
if(nRun==138392)proc_xsec=1000*0.011016*0.0018836;
if(nRun==138393)proc_xsec=1000*0.055663*0.0053725;
if(nRun==138394)proc_xsec=1000*0.036825*0.0062049;
if(nRun==138395)proc_xsec=1000*0.026769*0.0065461;
if(nRun==138396)proc_xsec=1000*0.016767*0.0065702;
if(nRun==138397)proc_xsec=1000*0.012078*0.005974;
if(nRun==138398)proc_xsec=1000*0.0095315*0.004967;
if(nRun==138399)proc_xsec=1000*0.0059951*0.0030928;
if(nRun==138400)proc_xsec=1000*0.034436*0.0084015;
if(nRun==138401)proc_xsec=1000*0.023438*0.0095772;
if(nRun==138402)proc_xsec=1000*0.017203*0.01015;
if(nRun==138403)proc_xsec=1000*0.010714*0.01021;
if(nRun==138404)proc_xsec=1000*0.0076257*0.0094436;
if(nRun==138405)proc_xsec=1000*0.0059175*0.0083252;
if(nRun==138406)proc_xsec=1000*0.0035922*0.0050144;
if(nRun==138407)proc_xsec=1000*0.024558*0.011308;
if(nRun==138408)proc_xsec=1000*0.016867*0.012516;
if(nRun==138409)proc_xsec=1000*0.012367*0.013521;
if(nRun==138410)proc_xsec=1000*0.0075798*0.013843;
if(nRun==138411)proc_xsec=1000*0.0052911*0.013676;
if(nRun==138412)proc_xsec=1000*0.0040105*0.012167;
if(nRun==138413)proc_xsec=1000*0.0023162*0.0072668;
if(nRun==138414)proc_xsec=1000*0.012912*0.015928;
if(nRun==138415)proc_xsec=1000*0.0088653*0.017476;
if(nRun==138416)proc_xsec=1000*0.0063933*0.019981;
if(nRun==138417)proc_xsec=1000*0.0037016*0.02348;
if(nRun==138418)proc_xsec=1000*0.0023911*0.026721;
if(nRun==138419)proc_xsec=1000*0.0016758*0.029238;
if(nRun==138420)proc_xsec=1000*0.00075211*0.026889;
if(nRun==138421)proc_xsec=1000*2.6206*0.0022407;
if(nRun==138422)proc_xsec=1000*0.30114*0.015028;
if(nRun==138423)proc_xsec=1000*0.15071*0.024151;
if(nRun==138424)proc_xsec=1000*0.075177*0.035954;
if(nRun==138425)proc_xsec=1000*0.050653*0.044848;
if(nRun==138426)proc_xsec=1000*0.038885*0.049963;
if(nRun==138427)proc_xsec=1000*0.023944*0.046855;
if(nRun==138428)proc_xsec=1000*0.32082*0.016264;
if(nRun==138429)proc_xsec=1000*0.1367*0.03099;
if(nRun==138430)proc_xsec=1000*0.083303*0.043534;
if(nRun==138431)proc_xsec=1000*0.046806*0.059156;
if(nRun==138432)proc_xsec=1000*0.032793*0.072341;
if(nRun==138433)proc_xsec=1000*0.025585*0.082845;
if(nRun==138434)proc_xsec=1000*0.016096*0.081458;
if(nRun==138435)proc_xsec=1000*0.15738*0.0314;
if(nRun==138436)proc_xsec=1000*0.080699*0.049416;
if(nRun==138437)proc_xsec=1000*0.054214*0.065319;
if(nRun==138438)proc_xsec=1000*0.031973*0.088218;
if(nRun==138439)proc_xsec=1000*0.02258*0.10227;
if(nRun==138440)proc_xsec=1000*0.017741*0.12069;
if(nRun==138441)proc_xsec=1000*0.011244*0.19935;
if(nRun==138442)proc_xsec=1000*0.064695*0.069384;
if(nRun==138443)proc_xsec=1000*0.040582*0.089659;
if(nRun==138444)proc_xsec=1000*0.028906*0.113;
if(nRun==138445)proc_xsec=1000*0.017589*0.15134;
if(nRun==138446)proc_xsec=1000*0.012551*0.1822;
if(nRun==138447)proc_xsec=1000*0.0098008*0.2592;
if(nRun==138448)proc_xsec=1000*0.0061466*0.43914;
if(nRun==138449)proc_xsec=1000*0.038925*0.10599;
if(nRun==138450)proc_xsec=1000*0.025772*0.12996;
if(nRun==138451)proc_xsec=1000*0.018382*0.1542;
if(nRun==138452)proc_xsec=1000*0.011288*0.21296;
if(nRun==138453)proc_xsec=1000*0.0079302*0.32914;
if(nRun==138454)proc_xsec=1000*0.0061157*0.40727;
if(nRun==138455)proc_xsec=1000*0.0036681*0.5781;
if(nRun==138456)proc_xsec=1000*0.027531*0.14073;
if(nRun==138457)proc_xsec=1000*0.018282*0.16587;
if(nRun==138458)proc_xsec=1000*0.01324*0.19775;
if(nRun==138459)proc_xsec=1000*0.0079463*0.27759;
if(nRun==138460)proc_xsec=1000*0.0055028*0.4268;
if(nRun==138461)proc_xsec=1000*0.0041918*0.47295;
if(nRun==138462)proc_xsec=1000*0.002379*0.63702;
if(nRun==138463)proc_xsec=1000*0.014274*0.22555;
if(nRun==138464)proc_xsec=1000*0.0095767*0.25374;
if(nRun==138465)proc_xsec=1000*0.0068185*0.29331;
if(nRun==138466)proc_xsec=1000*0.0039089*0.458;
if(nRun==138467)proc_xsec=1000*0.0025026*0.52609;
if(nRun==138468)proc_xsec=1000*0.001777*0.52882;
if(nRun==138469)proc_xsec=1000*0.00079502*0.53528;
if(nRun==138470)proc_xsec=1000*1.3787*0.0026114;
if(nRun==138471)proc_xsec=1000*0.2565*0.0098423;
if(nRun==138472)proc_xsec=1000*0.13919*0.013218;
if(nRun==138473)proc_xsec=1000*0.072752*0.014714;
if(nRun==138474)proc_xsec=1000*0.049567*0.015882;
if(nRun==138475)proc_xsec=1000*0.038202*0.016319;
if(nRun==138476)proc_xsec=1000*0.023626*0.012413;
if(nRun==138477)proc_xsec=1000*0.25843*0.013399;
if(nRun==138478)proc_xsec=1000*0.1225*0.021582;
if(nRun==138479)proc_xsec=1000*0.079098*0.02396;
if(nRun==138480)proc_xsec=1000*0.045488*0.023641;
if(nRun==138481)proc_xsec=1000*0.032064*0.02452;
if(nRun==138482)proc_xsec=1000*0.025105*0.02556;
if(nRun==138483)proc_xsec=1000*0.015903*0.019555;
if(nRun==138484)proc_xsec=1000*0.13117*0.026088;
if(nRun==138485)proc_xsec=1000*0.075226*0.033771;
if(nRun==138486)proc_xsec=1000*0.05191*0.03655;
if(nRun==138487)proc_xsec=1000*0.031177*0.038943;
if(nRun==138488)proc_xsec=1000*0.02224*0.035226;
if(nRun==138489)proc_xsec=1000*0.01755*0.037071;
if(nRun==138490)proc_xsec=1000*0.011139*0.030583;
if(nRun==138491)proc_xsec=1000*0.059442*0.053267;
if(nRun==138492)proc_xsec=1000*0.03876*0.060337;
if(nRun==138493)proc_xsec=1000*0.027786*0.065871;
if(nRun==138494)proc_xsec=1000*0.017229*0.072079;
if(nRun==138495)proc_xsec=1000*0.012359*0.071949;
if(nRun==138496)proc_xsec=1000*0.009696*0.071487;
if(nRun==138497)proc_xsec=1000*0.0060725*0.073358;
if(nRun==138498)proc_xsec=1000*0.036741*0.08245;
if(nRun==138499)proc_xsec=1000*0.024543*0.091834;
if(nRun==138500)proc_xsec=1000*0.017793*0.09705;
if(nRun==138501)proc_xsec=1000*0.011016*0.10691;
if(nRun==138502)proc_xsec=1000*0.0077967*0.12089;
if(nRun==138503)proc_xsec=1000*0.0060575*0.12947;
if(nRun==138504)proc_xsec=1000*0.0036629*0.15931;
if(nRun==138505)proc_xsec=1000*0.02595*0.10952;
if(nRun==138506)proc_xsec=1000*0.017586*0.1211;
if(nRun==138507)proc_xsec=1000*0.012823*0.13145;
if(nRun==138508)proc_xsec=1000*0.0078038*0.14456;
if(nRun==138509)proc_xsec=1000*0.0054363*0.16589;
if(nRun==138510)proc_xsec=1000*0.0040929*0.19167;
if(nRun==138511)proc_xsec=1000*0.0023569*0.38026;
if(nRun==138512)proc_xsec=1000*0.013563*0.17776;
if(nRun==138513)proc_xsec=1000*0.0092501*0.19321;
if(nRun==138514)proc_xsec=1000*0.0066573*0.20675;
if(nRun==138515)proc_xsec=1000*0.0038157*0.25521;
if(nRun==138516)proc_xsec=1000*0.0024594*0.29679;
if(nRun==138517)proc_xsec=1000*0.0017169*0.40316;
if(nRun==138518)proc_xsec=1000*0.00077807*0.59305;
if(nRun==138519)proc_xsec=1000*1.1106*0.0017886;
if(nRun==138520)proc_xsec=1000*0.22833*0.0054777;
if(nRun==138521)proc_xsec=1000*0.13117*0.0057616;
if(nRun==138522)proc_xsec=1000*0.070485*0.0044829;
if(nRun==138523)proc_xsec=1000*0.048476*0.0047913;
if(nRun==138524)proc_xsec=1000*0.03762*0.0046888;
if(nRun==138525)proc_xsec=1000*0.023402*0.0033386;
if(nRun==138526)proc_xsec=1000*0.22067*0.0090086;
if(nRun==138527)proc_xsec=1000*0.11382*0.011879;
if(nRun==138528)proc_xsec=1000*0.075572*0.012167;
if(nRun==138529)proc_xsec=1000*0.044337*0.0074902;
if(nRun==138530)proc_xsec=1000*0.031479*0.0070876;
if(nRun==138531)proc_xsec=1000*0.024763*0.0072353;
if(nRun==138532)proc_xsec=1000*0.015722*0.004806;
if(nRun==138533)proc_xsec=1000*0.11815*0.017606;
if(nRun==138534)proc_xsec=1000*0.071054*0.019678;
if(nRun==138535)proc_xsec=1000*0.049872*0.019381;
if(nRun==138536)proc_xsec=1000*0.030382*0.014729;
if(nRun==138537)proc_xsec=1000*0.021868*0.010516;
if(nRun==138538)proc_xsec=1000*0.017295*0.01007;
if(nRun==138539)proc_xsec=1000*0.011034*0.006913;
if(nRun==138540)proc_xsec=1000*0.055867*0.037827;
if(nRun==138541)proc_xsec=1000*0.036917*0.040339;
if(nRun==138542)proc_xsec=1000*0.026831*0.038682;
if(nRun==138543)proc_xsec=1000*0.016827*0.03237;
if(nRun==138544)proc_xsec=1000*0.012116*0.025322;
if(nRun==138545)proc_xsec=1000*0.0095615*0.017977;
if(nRun==138546)proc_xsec=1000*0.0060079*0.011889;
if(nRun==138547)proc_xsec=1000*0.03468*0.061224;
if(nRun==138548)proc_xsec=1000*0.023548*0.06321;
if(nRun==138549)proc_xsec=1000*0.017364*0.062431;
if(nRun==138550)proc_xsec=1000*0.010787*0.055762;
if(nRun==138551)proc_xsec=1000*0.0076473*0.046056;
if(nRun==138552)proc_xsec=1000*0.0059409*0.037253;
if(nRun==138553)proc_xsec=1000*0.0036134*0.020013;
if(nRun==138554)proc_xsec=1000*0.024842*0.085164;
if(nRun==138555)proc_xsec=1000*0.01697*0.088782;
if(nRun==138556)proc_xsec=1000*0.012453*0.086872;
if(nRun==138557)proc_xsec=1000*0.0076652*0.080775;
if(nRun==138558)proc_xsec=1000*0.0053338*0.071725;
if(nRun==138559)proc_xsec=1000*0.0040438*0.062972;
if(nRun==138560)proc_xsec=1000*0.0023266*0.032452;
if(nRun==138561)proc_xsec=1000*0.013105*0.13759;
if(nRun==138562)proc_xsec=1000*0.0089953*0.14356;
if(nRun==138563)proc_xsec=1000*0.0064585*0.14766;
if(nRun==138564)proc_xsec=1000*0.0037745*0.15137;
if(nRun==138565)proc_xsec=1000*0.0024198*0.1531;
if(nRun==138566)proc_xsec=1000*0.0016938*0.14975;
if(nRun==138568)proc_xsec=1000*0.00075949*0.11813;



  if(proc_xsec==0) cout<<"WARNING"<<endl<<"No Xsection found in the list"<<endl;

  return proc_xsec;
  
}

double calweight(double, double, double);
double calweight(double _xsec, double _ent, double lumi)
{
  return (_xsec*lumi/_ent);
}


void mcerr2(TH2F *&, double);
void mcerr2(TH2F *&h, double facto)
{
  
  for(int i=1; i<h->GetNbinsX()+1; i++){
    for(int j=1; j<h->GetNbinsY()+1; j++){
      double _nbinent=h->GetBinContent(i,j);
      if(_nbinent<=0)h->SetBinError(i, j, sqrt(_nbinent)*facto);
      else h->SetBinError(i, j, sqrt(_nbinent)*facto);
    }
  }
}

void mcerr(TH1F *&h, double facto)
{
  
  for(int i=1; i<h->GetXaxis()->GetNbins()+1; i++){
    double _nbinent=h->GetBinContent(i);
    if(_nbinent<=0)h->SetBinError(i, 0.);
    else h->SetBinError(i, sqrt(_nbinent)*facto);
  }

}
